package com.ease.job.quartz.service;

import java.util.Date;

import org.quartz.JobDetail;
import org.quartz.Trigger;

import com.ease.actionscript.Remoting;
import com.ease.job.quartz.support.CronJobExecutor;
import com.ease.job.quartz.support.CronJobStatus;
import com.ease.platform.authorization.service.AuthorizationService;

public interface CronJobExecutionService extends AuthorizationService {

	@Remoting(false)
	void addJobDetail(JobDetail jobDetail, Date startTime, Date endTime, int repeatCount, long repeatInterval);

	@Remoting(false)
	void addJobDetail(JobDetail jobDetail, String cronExpression);

	@Remoting(false)
	void addJobDetail(JobDetail jobDetail, Trigger trigger);

	CronJobExecutor getCronJobExecutor(String cronJobExecutorName);

	@Remoting(false)
	void addCronJobExecutor(CronJobExecutor cronJobExecutor);

	// manage all jobs
	void startAll();

	void pauseAll();

	void shutdownAll();

	// manage CronJobExecutor
	void start(String cronJobExecutorName);

	void pause(String cronJobExecutorName);

	void shutdown(String cronJobExecutorName);

	CronJobStatus getCronJobExecutorStatus(String cronJobExecutorName);

	/**
	 * 
	 * @return
	 */
	String getAllCronJobExecutorStatus();
}
